﻿String.Format = function() {
    if (arguments.length == 0)
        return "";
    if (arguments.length == 1)
        return arguments[0];
    var reg = /{(\d+)?}/g;
    var args = arguments;
    var result = arguments[0].replace(reg, function($0, $1) { return args[parseInt($1) + 1]; })
    return result;
}
